# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=py3-xlsxwriter
pkgver=3.2.0
pkgrel=0
pkgdesc="A Python module for creating Excel XLSX files"
url="https://github.com/jmcnamara/XlsxWriter"
arch="noarch"
license="BSD-2-Clause"
depends="python3"
makedepends="
	py3-gpep517
	py3-setuptools
	py3-wheel
	"
checkdepends="py3-pytest-xdist"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/jmcnamara/XlsxWriter/archive/RELEASE_$pkgver.tar.gz"
builddir="$srcdir"/XlsxWriter-RELEASE_$pkgver

replaces=py-xlsxwriter # Backwards compatibility
provides=py-xlsxwriter=$pkgver-r$pkgrel # Backwards compatibility

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest -n 2
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
b36ee896d01e5a6369f4f42e69338b69b9ea5ee4919eea9361c0f5f6ff012ca153c708ff1c719b82ce067c5d57392e3b72c47e828a7e832953d0c06de9f65962  py3-xlsxwriter-3.2.0.tar.gz
"
